/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
import java.awt.Color;
import java.awt.BorderLayout;
import java.awt.Graphics;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import javax.swing.*;
/**
 *
 * @author Martin Wilhelmsson
 */
public class GameFrame extends JFrame {

    boolean game = false;
    boolean menu = true;

    public GameFrame(boolean game) {
       setFrame (false);
       setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE);
       //setExtendedState(MAXIMIZED_BOTH); // maximerar fönstret, sätter dessa värden också till variabler som pass:as ner i träd till alla former av grafiska objekt! Passar alla skärmar dåe
       setSize(800, 600);
       setVisible( true );
       setAlwaysOnTop(false); //awlays on top all other windows if set to "true"
    }

    public void setFrame(boolean game){

         boolean changeMode = true;
         while(changeMode){
            if(game == true) {

                GamePanel panel = new GamePanel(); //
                add( panel );
                break;
            } //end of game == true

            else if (game == false) {

                Menu menu = new Menu(this); //
                add( menu );
                break;
            } //end of game==false
        }//end of while
    }//end of setframe
}
